package com.foreknow.test03;

import java.util.Scanner;

/**
 *
 */
public class ExampleDemo {
    public static void main(String[] args) {
        boolean bol=true;
        while (bol==true){
        System.out.println("********欢迎进入管理系统*********");
        System.out.println("1.注册");
        System.out.println("2.登录");
        System.out.println("3.抽奖");
        System.out.println("*****************************");
        System.out.print("请选择菜单：");
        String username;
        int password;
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();
            switch (number){
                case 1:
                    System.out.println("[管理系统]>注册");
                    System.out.println("请填写个人注册信息：");
                    System.out.print("用户名：");
                    username = sc.next();
                    System.out.print("密码：");
                    password = sc.nextInt();
                    System.out.println("注册成功：请您记好会员编号");
                    System.out.println("用户名      密码        会员编号");
                    System.out.println(username + "      " + password + "        " + (Math.round((Math.random() + 1) * 1000)));
                    break;
                case 2:
                    System.out.println("[管理系统]>登录");
                    System.out.print("请输入用户名：");
                    username = sc.next();
                    System.out.print("请输入密码：");
                    password = sc.nextInt();
                    System.out.println("欢迎您："+username);
                    break;
                case 3:
                    System.out.println("[管理系统]>抽奖");
                    break;
                default:
                    System.out.println("输入错误");
                    break;
            }
            System.out.println("是否继续？（y/n）");
            String str = sc.next();
            if("y".equals(str)){
                bol = true;
            }else{
                System.out.println("系统退出，谢谢使用");
                bol =false;
            }
        }
    }
}
